import datetime
import time
def count_time(f):
    def second_time(*args,**kw):
        start_time=datetime.datetime.now()
        f()
        over_time = datetime.datetime.now()
        total_time = (over_time-start_time).total_seconds()
        print('程序共运行%s秒'% total_time)
    return second_time
@count_time
#测试函数运行时间
def function1():
    print('excute function<<')
    time.sleep(1)
function1()
# def print_hello():
#     print('hello,python')
#
# print_hello()
